<template>
  <div> {{apiData}}
  </div>
</template>

<script>
export default {
  async fetch({ store, error }) {
    try {
      await store.dispatch("events/getApiData");
    } catch (err) {
      error({
        statusCode: 404,
        message: "服务端api请求发生错误" + err.message,
      });
    }
  },
  head() {
    return {
      title: "event"+ this.id,
      meta: [
        {
          hid: "event",
          name: "event",
          content: "event简介",
        },
      ],
    };
  },
  computed: {
    apiData(){
      return this.$store.getters["events/apiData"];
    },
    id() {
      return this.$route.params.id;
    },
  },
}
</script>
